<extend name="Public/base"/>

<block name="body">
    <form method="POST" id="form1" action="">
        <div class="main-title">
            <h2>每日分拣计划列表</h2>
        </div>
        <div class="data-table table-striped">
            <table>
                <thead>
                <tr>
                    <th>ID</th>
                    <th>周期计划名称</th>
                    <th>状态</th>
                    <th>计划开始时间</th>
                    <th>计划结束时间</th>
                    <th>计划分拣量</th>
                    <th>实际完成分拣量</th>
                    <th>计划完成比例</th>
                    <th>计划备注</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <notempty name="_list">
                    <volist name="_list" id="vo">
                        <tr>
                            <td>{$vo.id} </td>
                            <td>{$vo.planname}</td>
                            <td>{$vo.process|get_sort_planprocess}</td>
                            <td>{$vo.planstart|time_format}</td>
                            <td>{$vo.planend|time_format}</td>
                            <td>{$vo.plancnt}</td>
                            <td>{$vo.realitycnt}</td>
                            <td>{$vo.id|get_sort_plancomplete|number_format=###,2}%</td>
                            <td>{$vo.remark}</td>
                            <td><a href="{:U('Sort/plandetailread',array('id'=>$vo['id']))}" class="btn btn-success">明细</a>
                            </td>
                        </tr>
                    </volist>
                    <else/>
                    <td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
                </notempty>
                </tbody>
            </table>
        </div>
        <div class="page">
            {$_page}
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">

        $(function () {
            $('.time').datetimepicker({
                format: 'Y-m-d',
                language: "zh-CN",
                minView: 2,
                autoclose: true
            });
        });

        $("#search").click(function () {
            var url = $(this).attr('url');

            var query = $('.search-form').find('input').serialize();
            var queryselect = $('.search-form').find('select').serialize();

            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            queryselect = queryselect.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            queryselect = queryselect.replace(/^&/g, '');

            if (url.indexOf('?') > 0) {
                url += '&' + query;
                url += '&' + queryselect;
            } else {
                url += '?' + query;
                url += '?' + queryselect;
            }

            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        highlight_subnav('{:U('Sort/sortmonth')}');
    </script>
</block>